<template>
	<view>
		<uni-steps :options="list1" :active="2"></uni-steps>
		<uni-card>
			<view class="u-demo-title">
				{{chen.first}}———全程{{chen.mileage}}公里————{{chen.end}}
			</view>
		</uni-card>
		<uni-card title="乘客信息">
			<u-field v-model="name" label="乘客姓名" placeholder="点击输入"></u-field>
			<u-field v-model="phone" label="手机号码" placeholder="点击输入"></u-field>
			<u-field v-model="shanc" label="上车地点" placeholder="点击输入"></u-field>
			<u-field v-model="xiac" label="下车地点" placeholder="点击输入"></u-field>
		</uni-card>
		<uni-group style="position: fixed;bottom: 0%;right: 0%;left: 0%;z-index: 99;">
			<button type="primary" @click="xia">下一步</button>
		</uni-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: [{
						title: '第一步'
					},
					{
						title: '第二步'
					},
					{
						title: '第三步'
					},
					{
						title: '第四步'
					}
				],
				chen:[],
				name:'',
				phone:'',
				shanc:'',
				xiac:'',
			}
		},
		onLoad(options) {
			this.getchen()
		},
		methods: {
			xia(){
				if(this.name == ''|this.phone == ''|this.shanc == ''|this.xiac == ''){
					uni.showToast({
						title:'输入框不能为空',
						icon:'none'
					})
					return
				}
				let list = []
				list.push({
					name:this.name,
					phone:this.phone,
					shanc:this.shanc,
					xiac:this.xiac,
				})
				uni.setStorage({
					key:'xinxi',
					data:list,
					success: (res) => {
						uni.navigateTo({
							url:'ban4'
						})
					}
				})
			},
			getchen(){
				this.chen = uni.getStorageSync('ban')
			}
		}
	}
</script>

<style>

</style>
